<!DOCTYPE html>
<html>

<head>
  <title></title>
  <meta charset="utf-8">
  <meta name="viewport" content="width=device-width, initial-scale=1">
  <link href="../bootstrap-5.1.3-dist/css/bootstrap.css" rel="stylesheet">
  <script src="../bootstrap-5.1.3-dist/js/bootstrap.bundle.js"></script>
</head>

<body class="container">
  <h2 align="center">设置提示框的显示位置</h2>
  <button type="button" class="btn btn-lg btn-danger ml-5" data-bs-toggle="tooltip" data-bs-placement="left"
    data-bs-trigger="click" title="提示框信息">向左</button>
  <button type="button" class="btn btn-lg btn-danger ml-5" data-bs-toggle="tooltip" data-bs-placement="right"
    data-bs-trigger="click" title="提示框信息">向右</button>
  <div class="mt-5 mb-5">
    <hr>
  </div>
  <button type="button" class="btn btn-lg btn-danger ml-5 " data-bs-toggle="tooltip" data-bs-placement="top"
    data-bs-trigger="click" title="提示框信息">向上</button>
  <button type="button" class="btn btn-lg btn-danger ml-5" data-bs-toggle="tooltip" data-bs-placement="bottom"
    data-bs-trigger="click" title="提示框信息">向下</button>
</body>
<script>
  var tooltipTriggerList = [].slice.call(document.querySelectorAll('[data-bs-toggle="tooltip"]'))
  var tooltipList = tooltipTriggerList.map(function (tooltipTriggerEl) {
    return new bootstrap.Tooltip(tooltipTriggerEl)
  })
</script>

</html>